package com.tang.lts.core.ec;

import com.tang.lts.core.constant.ExtConfig;
import com.tang.lts.core.spi.SPI;

/**
 * @author Tang
 * @classname EventCenter
 * @description [  ]
 * @date 2022/4/13 22:09
 */
@SPI(key = ExtConfig.EVENT_CENTER,dftValue = "injvm")
public interface EventCenter {

    /**
     * subscribe
     * @param eventSubscribe
     * @param topic
     */
    public void subscribe(EventSubscriber eventSubscribe, String topic);

    /**
     * unSubscribe
     * @param eventSubscribe
     * @param topic
     */
    public void unSubscribe(EventSubscriber eventSubscribe, String topic);

    /**
     * publishSync
     * @param eventInfo
     */
    public void publishSync(EventInfo eventInfo);

    /**
     * publishAsync
     * @param eventInfo
     */
    public void publishAsync(EventInfo eventInfo);

}